﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using PLCSimulator.SymbolShapes;
using PLCSimulator.Views;
namespace PLCSimulator.Editor
{
    public class ButtonDescriptor : IDescriptor
    {
        public string Category { get; set; } = "ButtonDescriptor";

        public void CreateSymbol(Editor editor, EditorDiagramView Diagram,Point pointF)
        {
            var element = Symbol.Skin(SymbolShape.Button);
            element.Width = 36;
            element.Height = 36;
            Diagram.Add(element,pointF);
        }

        private FrameworkElement? _glyph;

        public FrameworkElement Glyph
        {
            get
            {
                if (_glyph == null)
                {
                    _glyph = Symbol.Skin(SymbolShape.Button);
                    _glyph.Width = 36;
                    _glyph.Height = 36;
                }
                return _glyph;
            }
            set { _glyph = value; }
        }

    }
}
